/**
 * 
 * @author Sergii Serba
 * @version 0.0, 27/01/2013
 * 
 */
public class Neighbour {
     /**
	 * This method is parsing String into int.
	 * 
	 */
	private int[] parse(String[] inPutNumbers) {
		int amount = 5;// number of numbers
		int[] numbers = new int[amount];
		for (int i = 0; i < inPutNumbers.length; i++) {
			numbers[i] = Integer.parseInt(inPutNumbers[i]);
		}
		return numbers;
	}
    /**
	 * This method creates an array of differences.
	 * 
	 */
	private int[] difference(int[] numbers) {

		int j = 0;
		int[] results = new int[numbers.length - 1];
		for (int i = 0; i < numbers.length - 1; i++) {
			int res = numbers[i + 1] - numbers[i];
			if (res < 0) {
				res = -res;
			}
			results[j] = res;
			j++;
		}
		return results;
	}
    /**
	 * This method searches index for the minimum element of the array.
	 * 
	 */
	private int find(int[] results) {
		int x = 0;
		for (int i = 0; i < results.length; i++) {
			if (results[x] > results[i]) {
				x = i;
			}
		}
		return x;
	}

	public static void main(String[] args) {
		Neighbour ob = new Neighbour();
		System.out.println(ob.find(ob.difference(ob.parse(args))));

	}
}
